/*vEFB8s2e8AGly3oD2HHeZ8lbCU+OQdQy95EaFnM9ZBOjsWAA99+Vv13ObDzrzt0b*/
/*
 * @Descripttion: 创建一主多子数据(edittable和form)
 * @version:
 * @Author: Chendch
 * @Date: 2020-12-25 17:26:15
 * @LastEditors: Chendch
 * @LastEditTime: 2021-04-12 16:27:06
 */
//
export default function createExtEditData(props, pageid, head_code, bodys_code, rows) {
    let saveData = {
        pageid,
        head: {},
        bodys: {},
    };
    let metaObj = props.meta.getMeta();
    saveData.templetid = metaObj.pageid && metaObj.pageid;
    if (metaObj[head_code] && metaObj[head_code].moduletype && metaObj[head_code].moduletype === 'form') {
        saveData.head[head_code] = props.form.getAllFormValue(head_code);
        saveData.head[head_code].areacode = head_code;
    }
    if (bodys_code && bodys_code instanceof Array && bodys_code.length > 0) {
        bodys_code.forEach(body_code => {
            if (
                metaObj[body_code] &&
                metaObj[body_code].moduletype &&
                metaObj[body_code].moduletype === 'table'
            ) {
                if (rows) {
                    saveData.bodys[body_code] = {
                        areaType: 'table',
                        rows,
                        areacode: null,
                    };
                } else {
                    saveData.bodys[body_code] = props.editTable.getAllData(body_code);
                }

                saveData.bodys[body_code].areacode = body_code;
            }
        });
    }
    return saveData;
}
/*vEFB8s2e8AGly3oD2HHeZ8lbCU+OQdQy95EaFnM9ZBOjsWAA99+Vv13ObDzrzt0b*/
